<template>
    <div class="goodDataList">
        <div class="list-data-title">
            <div class="title-1"><span>产品名称</span></div>
            <div class="title-2"><span>库存</span></div>
            <div class="title-3"><span>金额</span></div>
        </div>
        <div class="list-data-box comm-list" v-infinite-scroll="load">
            <div class="list-row" v-for="item in goodlist" :key="item.gdid">
                <div class="list-data-1" @click="openStockFun(item)">
                    <div class="data-1">
                        <span>{{ item.goods_name }}</span>
                    </div>
                    <div class="data-2">
                        <span>{{ item.qty_min }}</span>
                    </div>
                    <div class="data-3">
                        <span>{{ item.amount }}</span
                        ><i class="el-icon-arrow-right"></i>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import config from "../../js/conf/Config.js";
export default {
    name: "goodDataList",
    props: ["goodlist"],
    data() {
        return {};
    },
    methods: {
        load() {
            this.$emit("load");
        },
        openStockFun(item) {
            this.$emit("openStockFun", item);
        },
    },
};
</script>

<style lang="scss" scoped>
.goodDataList {
    padding: 10px;

    .list-data-title {
        height: 50px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f2f2f2;
        color: #a6a6a6;
        text-align: center;
        padding: 0 10px;
        font-size: 14px;
        .title-1 {
            text-align: left;
        }
        .title-3 {
            text-align: right;
        }
    }
    .list-data-box {
        height: 800px;
        overflow: auto;
        margin-top: 10px;
        .list-row {
            margin-bottom: 10px;
            .data-1 {
                flex: 1;
                display: -webkit-box;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 1;
                overflow: hidden;
            }
            .data-2 {
                text-align: center;
                flex: 1;
            }
            .data-3 {
                text-align: right;
                flex: 1;
                span {
                    margin-right: 10px;
                }
            }
        }
        .list-data-1 {
            height: 35px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-left: 10px;
            cursor: pointer;
            .data-2 {
                padding-left: 20px;
            }
            &:hover {
                background: #f8f8f8;
            }
        }
    }
}
</style>